package test;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import dto.BienDto;
import entities.BienBean;

public class Inicio {
	
	
	public static void main(String[] args) {
		
		//new Sistema().bienesMasDeUnContribuyente();
				
		SessionFactory sf = hbt.HibernateUtil.getSessionFactory();
		Session s = sf.openSession();
		
//		List<BienBean> qRes = s.createQuery("from BienBean b"
//				+ " where b.registro in (select b.registro"
//				+ "                           from ContribuyenteBean c"
//				+ "                      inner join c.BienBean b"
//				+ "                       group by b.registro"
//				+ "                       having count(*)>1) "
//				+ "").list();
		
		
		@SuppressWarnings("unchecked")		
		List <BienBean> bb = s.createQuery("from BienBean b"
				+ " inner join b.contribuyentes c").list();		
		
		for(BienBean o:bb){
			System.out.println(o.toString());
		}
	}
}
